package com.zhaorujie.rpc.core.route;

import com.zhaorujie.rpc.core.spi.SpiLoader;

/**
 * @author 赵汝杰
 * @version v1.0
 * @description LoadBalanceFactory
 * @date 2024/3/13
 **/
public class LoadBalanceFactory {

    // SPI动态加载
    static {
        SpiLoader.load(RpcLoadBalance.class);
    }

    /**
     * 获取实例
     * @param key
     * @return
     */
    public static RpcLoadBalance getInstance(String key) {
        return SpiLoader.getInstance(RpcLoadBalance.class, key);
    }
}
